﻿@{
    ViewBag.Title = "新增部门";
}
@model FMS.UI.Areas.Admin.ViewModel.Department 
@section headsecion{
    <style type="text/css">
        .tbList tr {
            height: 34px;
        }

        .tbList {
            border: 1px solid #ddd;
            height: 99.5%;
            border-collapse: collapse;
            margin: 0px;
            padding: 0px;
            width: 100%;
            border-top-width: 0px;
            border-bottom-width: 0px;
            border-left-width: 0px;
            border-right-width: 0px;
        }

            .tbList td, th {
                border: 1px solid #ddd;
                padding: 0px 5px;
            }

        #tdname {
            width: 130px;
        }

        body {
            margin: 0px;
            align-self: center;
        }

        #tdname {
            text-align: center;
        }

        #form0 {
            margin: 0px;
            padding: 0px;
        }
    </style>

    <script type="text/javascript">
        $(function () {
            $("#depRemark").change(depChange);

    

        })
        function depChange()
        {                
           var compVal = this.value;
           $("#depCompId").val(compVal);
           
        }

        function begin(bool, text) {         
        }

        function complete(xhrobj) {       
            $.msgProcess(xhrobj.responseText, function () {
                $.globalHelper.closeCommonWindow();
                $.globalHelper.reloadSeletecTabDataGrid();
            })
        }
    </script>
}
@using (Ajax.BeginForm(new AjaxOptions() { OnBegin = "begin", OnComplete = "complete" }))
{

    <table id="tbList" class="tbList">
        <tr>
            <td id="tdname">@Html.DisplayNameFor(o => o.depName)</td>
            <td>@Html.TextBoxFor(o => o.depName)  @Html.ValidationMessageFor(o => o.depName)</td>

        </tr>
        <tr>
            <td id="tdname">@Html.DisplayNameFor(o => o.depRemark)</td>
            <td id="depIdName">
                @Html.DropDownListFor(o => o.depRemark, (SelectList)ViewData["compList"], "请选择公司", new { @style = "width: 135px;" })
                @Html.TextBoxFor(o => o.depCompId, new {@type="hidden" })                
                @Html.ValidationMessageFor(o => o.depRemark, "选择公司")
            </td>
        </tr> 
        <tr>
            <td class="last" colspan="2" style="text-align:center;border:0px solid white;margin-bottom:0px">
                <input type="submit" value="确定" style="height: 27px; width: 56px; margin-top: 6px; cursor: pointer" />
            </td>
        </tr>
    </table>


}
